#ifndef __XBEELIBS2_H__
#define __XBEELIBS2_H__

#include <Arduino.h>
#include <XBee.h>

// Uncomment this line for debugging
#define		DEBUG_XBEE

#define		MAX_PAYLOAD		64
// API COMMAND TDSMOTE
#define		CONTINUE				0xFA
#define		CONNECTION				0xFB

extern		XBee _xbee;
extern volatile bool _sleep_interrupt;
extern		uint8_t	XBeeS2_lastDataReceived[MAX_PAYLOAD];
extern		uint8_t XBeeS2_lenghtDataReceived;

char		XBeeS2_Start( );
bool		XBeeS2_SendDataToAddrXBee (uint32_t _msb, uint32_t _lsb, uint8_t* _data, uint8_t _size);
bool		XBeeS2_SendArrayToAddrXBee (uint32_t _msb, uint32_t _lsb, uint8_t* _data, uint16_t _size, uint8_t _cmd );
bool		XBeeS2_ReceiveDataFromXbee ( );
void		XBeeS2_ResetDataReceived ( void );
bool		XBeeS2_WaitContinue ( void );
bool		XBeeS2_CheckXBee ();
void		XBeeS2_ResetSendStatus ();

#endif